<html>
<head><meta charset="utf-8"><title>Joining · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html">Joining</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200087611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200087611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200087611">(Jun 08 2020 at 12:03)</a>:</h4>
<p>Hello! I've suddenly got a lot of time on my hands and I'd really like to get more involved in rustc. The rustc dev guide suggested joining a wg and mir opt is something I'm particularly interested in (although my knowledge of mir is very limited). Are there any issues that are a good place for me to start?</p>



<a name="200087852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200087852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200087852">(Jun 08 2020 at 12:06)</a>:</h4>
<p>Welcome! This one I filed a few days ago should be fairly straightforward: <a href="https://github.com/rust-lang/rust/issues/72959">https://github.com/rust-lang/rust/issues/72959</a></p>



<a name="200087940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200087940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200087940">(Jun 08 2020 at 12:07)</a>:</h4>
<p>Awesome! I'll have a look :)</p>



<a name="200089008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200089008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200089008">(Jun 08 2020 at 12:19)</a>:</h4>
<p>Something else that would be fairly useful would be documenting the MIR invariants that the validator and Miri are enforcing as doc comments on the MIR types themselves</p>



<a name="200089213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200089213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200089213">(Jun 08 2020 at 12:21)</a>:</h4>
<p>I can definitely have a look at that as well</p>



<a name="200089299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200089299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200089299">(Jun 08 2020 at 12:22)</a>:</h4>
<p>For unwind blocks I think this is already the case</p>



<a name="200089326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200089326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200089326">(Jun 08 2020 at 12:22)</a>:</h4>
<p>(As in the invariant is documented, but it's not yet enforced)</p>



<a name="200092895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200092895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200092895">(Jun 08 2020 at 12:56)</a>:</h4>
<p>I had a quick look (<a href="https://github.com/rust-lang/rust/issues/73133">#73133</a>) some feedback on how to write tests/if this is the right idea would be amazing</p>



<a name="200103032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200103032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200103032">(Jun 08 2020 at 14:15)</a>:</h4>
<p>unfortunately we have no way to generate arbitrary MIR, but we'd like to have: <a href="https://github.com/rust-lang/miri/issues/196">https://github.com/rust-lang/miri/issues/196</a></p>



<a name="200103107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200103107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200103107">(Jun 08 2020 at 14:16)</a>:</h4>
<p>without a way to generate abitrary MIR, you can't test for broken MIR, as rustc should not be emitting broken MIR</p>



<a name="200103227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200103227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200103227">(Jun 08 2020 at 14:17)</a>:</h4>
<p>note that your validation checks seem to have found a bug in the MIR building phase</p>



<a name="200103502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200103502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200103502">(Jun 08 2020 at 14:18)</a>:</h4>
<p>You can also set <code>RUSTFLAGS_NOT_BOOTSTRAP=-Zvalidate-mir</code> to run the validator after every MIR transformation. This should give you a good idea of whether some pass produces broken MIR.</p>



<a name="200108713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200108713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200108713">(Jun 08 2020 at 14:54)</a>:</h4>
<p>Ok, thanks a lot! I'll investigate the breakage (just want to check should all edges between cleanup blocks be unwind?)</p>



<a name="200109055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109055">(Jun 08 2020 at 14:56)</a>:</h4>
<p>No, they can also have normal edges</p>



<a name="200109086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109086">(Jun 08 2020 at 14:56)</a>:</h4>
<p>But once in a cleanup block you can never go back to a non-cleanup block</p>



<a name="200109257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109257">(Jun 08 2020 at 14:57)</a>:</h4>
<p>Ok got it!</p>



<a name="200109797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109797">(Jun 08 2020 at 15:00)</a>:</h4>
<p>With that relaxation the validation seems to pass fine</p>



<a name="200109846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109846">(Jun 08 2020 at 15:00)</a>:</h4>
<p>Edges between cleanup blocks should only be normal edges.</p>



<a name="200109946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200109946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200109946">(Jun 08 2020 at 15:01)</a>:</h4>
<p>Ah, right</p>



<a name="200110021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200110021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200110021">(Jun 08 2020 at 15:01)</a>:</h4>
<p>Panicking in cleanup aborts</p>



<a name="200110161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200110161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200110161">(Jun 08 2020 at 15:02)</a>:</h4>
<p>should this use a dataflow algorithm?</p>



<a name="200110226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200110226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200110226">(Jun 08 2020 at 15:03)</a>:</h4>
<p>any custom algorithm would have to basically replicate dataflow I think</p>



<a name="200110428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200110428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200110428">(Jun 08 2020 at 15:04)</a>:</h4>
<p>We mark which blocks are cleanup. There's no need for dataflow.</p>



<a name="200110433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/200110433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#200110433">(Jun 08 2020 at 15:04)</a>:</h4>
<p>Ok that's an easy fix - I don't think it needs data-flow</p>



<a name="201474493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Joining/near/201474493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Joining.html#201474493">(Jun 20 2020 at 11:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Joining/near/200103502">said</a>:</p>
<blockquote>
<p>You can also set <code>RUSTFLAGS_NOT_BOOTSTRAP=-Zvalidate-mir</code> to run the validator after every MIR transformation. This should give you a good idea of whether some pass produces broken MIR.</p>
</blockquote>
<p>oh <em>that</em>s how you do that :D</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>